package com.qfxl.common.comm.parVeridy;

import java.util.List;

/**
 * @Author cj
 * @Date 2023/11/23 10:59
 * @Version 1.0
 */

public enum ParTypeEnum {

    /**
     * 空
     */
    NONE(000, null, null),
    /**
     * 正则校验
     */
    regex(200, VerifyCommValueInterface.regex, VerifyCommValueInterface.check_regex_error),
    /**
     * 判断参数类型必须是 整数
     */
    isInt(103, VerifyCommValueInterface.isInt, VerifyCommValueInterface.check_is_int
            , true, Integer.class, int.class),
    /**
     * 判断参数类型必须是 数字
     */
    isNumber(102, VerifyCommValueInterface.isNumber, VerifyCommValueInterface.check_is_number),
    /**
     * 判断参数类型必须是 字符串
     */
    isString(101, VerifyCommValueInterface.isString, VerifyCommValueInterface.check_is_string
            , true, String.class),
    /**
     * 判断参数类型必须是 数组
     */
    isArray(100, VerifyCommValueInterface.isArray, VerifyCommValueInterface.check_is_array
            , true, List.class),
    /**
     * 非空校验，也就必填校验
     */
    notBlank(0, VerifyCommValueInterface.notBlank, VerifyCommValueInterface.check_is_blank);


    private int code;

    private String type;

    private String message;

    private Class[] aClass;

    private boolean isType = false;


    public String getMessage() {
        return this.message;
    }

    public String getType() {
        return this.type;
    }

    public boolean isType() {
        return isType;
    }

    public int getCode() {
        return this.code;
    }

    public Class[] getaClass() {
        return this.aClass;
    }

    ParTypeEnum(int code, String type) {
        this.code = code;
        this.type = type;
    }

    ParTypeEnum(int code, String type, String message) {
        this.code = code;
        this.type = type;
        this.message = message;
    }

    ParTypeEnum(int code, String type, String message, boolean isType, Class... aClass) {
        this.code = code;
        this.isType = isType;
        this.type = type;
        this.message = message;
        this.aClass = aClass;
    }

}
